import { getDirname, path } from "vuepress/utils";
import { hopeTheme } from "vuepress-theme-hope";
import type { ThemeOptions } from "vuepress-theme-hope";
import { enNavbar, zhNavbar } from "../navbar/index.js";
import { enSidebar, zhSidebar } from "../sidebar/index.js";
import { recoTheme } from 'vuepress-theme-reco';

const __dirname = getDirname(import.meta.url);

export default recoTheme({
  hostname: "https://xksaturn.com",

  author: {
    name: "暖暖",
    url: "https://xksaturn.com",
  },

  // pure: true,
  lastUpdated: false,

  iconAssets: "fontawesome-with-brands",

  logo: "https://image.xiaosaturn.com/Yunyi-Huang/sleep-red-book-1m.png",

  // repo: "vuepress-theme-hope/vuepress-theme-hope",

  docsDir: "src",

  fullscreen: true,

  blog: {
    medias: {
      Baidu: "https://example.com",
      BiliBili: "https://example.com",
    },
  },

  locales: {
    "/zh/": {
      // navbar
      navbar: zhNavbar,

      // sidebar
      sidebar: zhSidebar,

      footer: "暖暖",

      copyright: "Copyright © 2024 暖暖",

      displayFooter: true,

      blog: {
        description: "暖暖的生活记录",
        intro: "/zh/intro.html",
        articleInfo: ["Author", "PageView", "Original", "Date", "Category"]
      },

      metaLocales: {
        editLink: "在 GitHub 上编辑此页",
      },
    },

    /**
     * English locale config
     */
    "/": {
      // navbar
      navbar: enNavbar,

      // sidebar
      sidebar: enSidebar,

      footer: "Amara",

      copyright: "Copyright © 2024 Amara",

      displayFooter: true,

      blog: {
        description: "Record Every Day",
        intro: "/intro.html",
        articleInfo: ["Author", "PageView", "Original", "Date", "Category"]
      },

      // page meta
      metaLocales: {
        editLink: "Edit this page on GitHub",
      },
    },
  },

  encrypt: {
    config: {
      "/demo/encrypt.html": ["1234"],
      "/zh/demo/encrypt.html": ["1234"],
    },
  },

  plugins: {
    blog: true,

    comment: {
      provider: "Waline",
      serverURL: "https://com.xksaturn.com/",
    },

    components: {
      components: ["Badge", "VPCard"],
    },

    mdEnhance: {
      align: true,
      attrs: true,
      codetabs: true,
      component: true,
      demo: true,
      figure: true,
      imgLazyload: true,
      imgSize: true,
      include: true,
      mark: true,
      stylize: [
        {
          matcher: "Recommended",
          replacer: ({ tag }) => {
            if (tag === "em")
              return {
                tag: "Badge",
                attrs: { type: "tip" },
                content: "Recommended",
              };
          },
        },
      ],
      sub: true,
      sup: true,
      tabs: true,
      tasklist: true,
      vPre: true,
      mathjax: true,
    },

    searchPro: {
      indexContent: true,
      autoSuggestions: true,
      queryHistoryCount: 10,
    },

    prismjs: true,
  },
})
